import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrEmployeeChangeApplyVO, HrEmployeeChangeApplyForm, HrEmployeeChangeApplyQuery } from '@/api/general/humanresources/mobility/change/types';

/**
 * 查询员工异动申请审批列表
 * @param query
 * @returns {*}
 */

export const listHrEmployeeChangeApply = (query?: HrEmployeeChangeApplyQuery): AxiosPromise<HrEmployeeChangeApplyVO[]> => {
  return request({
    url: '/humanresource/hrEmployeeChangeApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工异动申请审批详细
 * @param id
 */
export const getHrEmployeeChangeApply = (id: string | number): AxiosPromise<HrEmployeeChangeApplyVO> => {
  return request({
    url: '/humanresource/hrEmployeeChangeApply/' + id,
    method: 'get'
  });
};

/**
 * 新增员工异动申请审批
 * @param data
 */
export const addHrEmployeeChangeApply = (data: HrEmployeeChangeApplyForm) => {
  return request({
    url: '/humanresource/hrEmployeeChangeApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工异动申请审批
 * @param data
 */
export const updateHrEmployeeChangeApply = (data: HrEmployeeChangeApplyForm) => {
  return request({
    url: '/humanresource/hrEmployeeChangeApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工异动申请审批
 * @param id
 */
export const delHrEmployeeChangeApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrEmployeeChangeApply/' + id,
    method: 'delete'
  });
};
